<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/main.css" />
    <script type="text/javascript" src="../script/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/mobile.js"></script>
    <script type="text/javascript" src="../script/public.js"></script>
    <script type="text/javascript" src="../script/app.js"></script>
    <title>预订成功</title>
</head>
<body>
<header>
    <div class="zhifu_cgs">
        <div>
            <!--<img src="../image/jiant_rg.png" alt="">-->
            <p>我的预定</p>
            <i class="dataimg">
                <img src="../image/riqi.png" alt="" onclick="open_winrs('rili','rili.html')">
            </i>
        </div>
    </div>
    <div class="alc_lisna">
        <ul>
            <li onclick="open_winrs('yuding','wode_yudin.html');"><p>全部</p></li>
            <li onclick="open_winrs('dind_dai','wode_yudin_dai.html');"><p>待用餐</p></li>
            <li class="chek_allcan" onclick="open_winrs('dind_yij','wode_yudin_yij.html');"><p>已用餐</p></li>
        </ul>
    </div>
    <div class="lins_mesg"></div>
</header>
<section>
    <div class="dind_lsit">
        <ul>
            <li id="quanbu">
                <!-- <span class="cikc_list">
                    <span><em>2018-08-22 10:11</em><i>5元</i></span>
                    <p><em>08-23 午餐</em><i>待用餐</i></p>
                </span>
                <span class="infom_lsi">
                    <i></i>
                    <input type="button" value="取消">
                </span> -->
            </li>
        </ul>
    </div>
</section>
<div class="ind_nalis">

    <ul>
        <li onclick="open_winrs('index','index.html');">
                <span>
                    <img class="shoede_na" src="../image/shouye1.png" alt="">
                    <img src="../image/shouye.png" alt="">
                    <p>首页</p>
                </span>
        </li>
        <li class="chek_nvts" onclick="open_winrs('resrtion','wode_yudin.html');">
                <span>
                    <img class="shoede_na" src="../image/dind1.png" alt="">
                    <img src="../image/dind.png" alt="">
                    <p>预订</p>
                </span>
        </li>
        <li onclick="open_winrs('imgsg','xiaoxi.html');">
                <span class="xiaoxx" id="unread">
                    <img class="shoede_na" src="../image/xiaox1.png" alt="">
                    <img src="../image/xioax.png" alt="">
                    <p>消息</p>
                   
                </span>
        </li>
        <li onclick="open_winrs('myslf','wode.html');">
                <span>
                    <img class="shoede_na" src="../image/wode1.png" alt="">
                    <img src="../image/wode.png" alt="">
                    <p>我的</p>
                </span>
        </li>
    </ul>
</div>
<!--弹窗-->
<div class="alt_win">

    <div>
        <div class="contnc">
            <img src="../image/zfcg.png" alt="">
            <p id="contnc"> </p>
            <input type="button" value="确定">
        </div>
        <img src="../image/clsgb.png" alt="">
    </div>
</div>
</body>
<script>

    $(function () {

        $(document).on("click",".infom_lsi input",function () {

            $(".alt_win").css("display","block");
        })

        $(document).on("click",".contnc input",function () {

            $(".alt_win").css("display","none");
        })

        $(document).on("click",".alt_win > div > img",function () {

            $(".alt_win").css("display","none");
        })


        $(document).on("click",".alc_lisna ul li",function () {

            if($(this).hasClass("chek_allcan")){

                return ;
            }else {

                $(this).siblings("li").removeClass("chek_allcan");
                $(this).addClass("chek_allcan");
            }
        })

        $(document).on("click",".dind_lsit ul li span.cikc_list",function (event) {

                event.stopPropagation();
            if($(this).next("span.infom_lsi").hasClass("addtan")){

                $(this).next("span.infom_lsi").removeClass("addtan");
            }else {

                $(this).parents("li").siblings("li").children("span.infom_lsi").removeClass("addtan");
                $(this).next("span.infom_lsi").addClass("addtan");
            }
        })
    })
</script>

<script type="text/javascript">
    window['adaptive'].desinWidth = 750;
    window['adaptive'].baseFont = 28;
    window['adaptive'].maxWidth = 750;
    window['adaptive'].init();

   
    apiready = function () {
        $api.fixStatusBar($api.dom('.header'));
        api.addEventListener({
            name: 'keyback'
        }, function(ret, err){
            api.closeWidget();
        });

         //未读消息
        s = {uid:id};
        api.ajax({
            url:webSiteUrl+'/app/user/message',
            method:'post',
            data:{
                values:s
            }
        },function(ret,err){
            if (ret.code == 200) {
                if (ret.data.unread != 0 ) {
                    $('#unread').html('<img class="shoede_na" src="../image/xiaox1.png" alt=""><img src="../image/xioax.png" alt=""><p>消息</p><em>'+ret.data.unread+'</em>');
                }else{
                    $('#unread').html('<img class="shoede_na" src="../image/xiaox1.png" alt=""><img src="../image/xioax.png" alt=""><p>消息</p>');
                }
            }else{
                alert(ret.msg);
            }
        });


         toDoRequest();

        api. addEventListener({name:'scrolltobottom'}, function(ret, err){
            
            toDoRequest();

        });


        
       
    }
    function toDoRequest(){
        var p = {type:2,uid:id};
         api.ajax({
            url:webSiteUrl+'/App/Record/my_reserve',
            method:'post',
            data:{
                values:p
            }
        },function(ret,err){
            if (ret.code == 200) {
               // alert(JSON.stringify(ret));
               var list = ret.data;
               html = '';
               if (list != null) {
                    for (var i=0 ; i < list.length ; i++) {
                       
                      html += '<span class="cikc_list"><span><em>'+list[i].days+' '+list[i].hour+'</em><i class="yijovs">'+list[i].price+'元</i></span><p><em>'+list[i].dc_time+' '+list[i].dc_name+'</em><i class="yijovs">已用餐</i></p></span>';
                      
                    }
               }
               
                    $('#quanbu').html(html);
                         
               
            }else{
                alert(ret.msg);
            }
        });
    }


        

    

  
    
</script>
</html>